window.onload = function() {

	oDiv = document.getElementById('div');

	document.onmousemove = moveDiv;
};

var oDiv = null;

function moveDiv(ev) {
	ev = ev || event;
	var scrollLeft = document.documentElement.scrollLeft || 
		document.body.scrollLeft;
	var scrollTop = document.documentElement.scrollTop || 
		document.body.scrollTop;
	oDiv.style.left = ev.clientX + scrollLeft + 'px';
	oDiv.style.top = ev.clientY + scrollTop + 'px';
}
